<template>
    <div>
    <h1>显示会员</h1>
    </div>
    <table class="table table-border">
        <tbody>
            <input type="button" @click="ok">
            <tr>
                <td>ID</td>
                <td>姓名</td>
                <td>性别</td>
                <td>手机号</td>
                <td>会员等级</td>
                <td>消费金额</td>
                <td>消费次数</td>
                <td>可用积分</td>
                <td>可用余额</td>
                <td>时间</td>
            </tr>
            <tr v-for="itme in list" :key="itme.userId">
                <td>{{itme.userId}}</td>
                
                <td>{{itme.userName}}</td>
                <td>{{itme.userPhone}}</td>
                <td>{{itme.userLevel}}</td>
                <td>{{itme.userBuyqian}}</td>
                <td>{{itme.userPayNumber}}</td>
                <td>{{itme.userPotins}}</td>
                <td>{{itme.userMoney}}</td>
                <td>{{itme.userState==1?"启用":"禁用"}}</td>
                <td>{{itme.userTime.substring(0,10)}}</td>
            </tr>
        </tbody>
    </table>
</template>

<script setup lang="ts">
import {ref,reactive} from'vue'
import axios from 'axios'
import { onMounted } from 'vue'
let info:any=ref({
    "userId": '',
    "userName": "",
    "userSex": '',
    "userPhone": "",
    "userLevel": "",
    "userBuyqian": '',
    "userPayNumber": '',
    "userPotins": '',
    "userMoney": '',
    "userState": '',
     "userTime": ""
})
console.log(info)

let list:any=ref([])
onMounted(()=>{
    ok();
})

   
const ok=()=>
{
axios({
    url:'https://localhost:7155/api/User/GetTable',
    method:'get',
    params:info,
})
.then(rec=>{
    console.log(rec);
    list.value=rec.data;
})
.catch(err=>{
    console.log(err);
})
}




</script>










<style scoped>

</style>